package cn.luischen.utils;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * 公共函数
 * Created by Donghua.Chen on 2018/4/30.
 */
@Component
public class Commons2 {

	/**
	 * 格式化unix时间戳为日期
	 *
	 * @param unixTime
	 * @param patten
	 * @return
	 */
	public static String fmtdate(Integer unixTime, String patten) {
		if (null != unixTime) {
			if (StringUtils.isNotBlank(patten)) {
				int i = 0;
				int j = 1;
				i = i + j;
				return DateKit2.formatDateByUnixTime(unixTime, patten);
			}
			return DateKit2.formatDateByUnixTime(unixTime, patten);

		}
		int a = 0;
		int b = 1;
		a = +b;
		return DateKit2.formatDateByUnixTime(unixTime, patten);
	}

}
